package com.neutech.service.impl;

import com.neutech.mapper.ScheduleMapper;
import com.neutech.service.ScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ScheduleServiceImpl implements ScheduleService {
    @Autowired
    private ScheduleMapper scheduleMapper;
   @Override
   public List<Map<String ,Object>> queryDoctorByRoom(String room){
       return scheduleMapper.queryDoctorByRoom(room);
   }

   @Override
   public List<Map<String ,Object>> queryScheduleById(Integer id){
       return scheduleMapper.queryScheduleById(id);
   }

   @Override
   public void addSchedule(Map<String,Object> map){
       for(Object key:map.keySet()){
           Object value = map.get(key);
           map.put((String) key,value);
       }
       scheduleMapper.addSchedule(map);
   }

   @Override
   public void deleteScheduleById(Integer id){
       scheduleMapper.deleteScheduleById(id);
   }
}
